package com.econ.powercloud.ems.controller;

import com.econ.powercloud.common.base.facade.pojo.MsgResult;
import com.econ.powercloud.ems.service.biz.FeeConfirmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author : zjf
 * @Description : 电费确认结算表
 * @Date : 2022/4/24 10:40
 * @Modified by : zjf
 */
@Api(tags = "电费确认结算管理")
@RestController
@RequestMapping(value = "/api/v2/fee/confirm")
public class FeeConfirmController extends ApiBaseController {
    @Autowired
    private FeeConfirmService feeConfirmService;

    @GetMapping("getData")
    @ApiOperation(value="获取储能装置电费结算确认表", notes="获取储能装置电费结算确认表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "stationId", value = "储能站id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "equipmentId", value = "储能装置id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType="query", name = "startTime", value = "起始时间", required = true, dataType = "Long"),
            @ApiImplicitParam(paramType="query", name = "endTime", value = "结束时间", required = true, dataType = "Long")
    })
    public MsgResult<List<Map<String,String>>> getIncomeDataByDay(@RequestParam("stationId")String stationId, @RequestParam("equipmentId")String equipmentId,
                                                                  @RequestParam("startTime")Long startTime, @RequestParam("endTime")Long endTime){
        return successHandler(feeConfirmService.getDataByCondition(stationId, equipmentId, startTime, endTime));
    }

    @GetMapping("getSpecialExplain")
    @ApiOperation(value="获取储能站特别文案说明", notes="获取储能站特别文案说明")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType="query", name = "stationId", value = "储能站id", required = true, dataType = "String")
    })
    public MsgResult<String> getSpecialExplain(@RequestParam("stationId")String stationId){
        return successHandler(feeConfirmService.selectSpecialExplainByStationId(stationId));
    }

}
